<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="st" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="j" uri="j/tags" %>
<style>
    .tabs-container .panel-body{
        overflow: hidden!important;
    }
</style>
<st:page title="查询管理">
    <div data-options="region:'west',split:true,title:'资源分类'" style="width:200px;z-index: 999;">
        <ul class="easyui-tree" data-options="url:'/user/center?act=menu',animate:true,onClick:functionTreeClick"></ul>
    </div>
    <!-- 中间区域的主部分 -->
    <div data-options="region:'center',border:false">
        <div id="tt1" class="easyui-tabs" data-options="fit:true,onSelect:tabOnSelect">
            <div title="查询管理">
                <iframe scrolling="auto" frameborder="no" hidefocus="" src="/user/pd?fid=<j:des data="20130926114233000134"/>&page=<j:des data="qmd/queryManager"/>" id="mainFrame1"></iframe>
            </div>
            <div title="请求管理" data-options="fit:true,contentUrl:'/user/pd?fid=<j:des data="20130926114233000134"/>&page=<j:des data="qmd/requestManager"/>'">
            </div>
        </div>
    </div>
    <script>
        var nodeId = "";
        function functionTreeClick(node){
            nodeId = node.id;
            if(nodeId != ""){
                var $tab=$("#tt1");
                var tab = $tab.tabs('getSelected');
                var index = $tab.tabs('getTabIndex',tab);
                tabOnSelect("",index);
            }
        }
        function tabOnSelect(title,index){
            /*var id = "mainFrame1";
            if(index == 1){
                id="mainFrame2";
            }
                var iframe = document.getElementById(id);
                iframe.contentWindow.init();*/
            var tab = $("#tt1").tabs("getTab",index);
            var $iframe = tab.find("iframe");
            if($iframe.length==0){
                //无找到
                var options = tab.panel("options");
                $iframe = $('<iframe scrolling="auto" frameborder="no" hidefocus=""></iframe>');
                $iframe.appendTo(tab);
                $iframe.attr("src",options.contentUrl);
            }
            var contentWin = $iframe[0].contentWindow;
            if(typeof contentWin.init === "function"){
                contentWin.init();
            }
        }
    </script>
</st:page>